package com.luo.locationapp.utils;

import java.io.File;
import java.util.List;

import android.content.Context;

public class UploadThead {
	private List<String> path;
	private String url;
	private boolean isRunning;
	private Context context;
	
	public UploadThead(Context context){
		this.context = context;
		isRunning = true;
	}
	public void doUpload(){
		new Thread(runnable).run();
	}
	public List<String> getPath() {
		return path;
	}
	public void setPath(List<String> path) {
		this.path = path;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public boolean isRunning() {
		return isRunning;
	}
	public void setRunning(boolean isRunning) {
		this.isRunning = isRunning;
	}
	
	Runnable runnable = new Runnable() {
		@Override
		public void run() {
			for(String p:path){
				FileUpload.uploadFile(new File(p), "http://192.168.1.102:8080/fileServer/ImageServlet");
			}
		}
	};
}
